x86, xsplice: Print payload's symbol name and payload name in backtraces
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 27 Apr 2016 15:30:25 +0000 (11:30 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 29 Apr 2016 07:58:47 +0000 (03:58 -0400)
commitd5ccf4482e4f3c99f1bcae242ce67bdd51f52537
tree5000eca0ce0c96cfdc825ff06a496c98916c1583
parentab3e5f5ff924093bb071776027f7b1fd90f9329d
x86, xsplice: Print payload's symbol name and payload name in backtraces

Naturally the backtrace is presented when an instruction
hits an bug_frame or %p is used.

The payloads do not support bug_frames yet - however the functions
the payloads call could hit an BUG() or WARN().

The traps.c has logic to scan for it this - and eventually it will
find the correct bug_frame and the walk the stack using %p to print
the backtrace. For %p and symbols to print a string -  the
'is_active_kernel_text' is consulted which uses an 'struct virtual_region'.

Therefore we register our start->end addresses so that
'is_active_kernel_text' will include our payload address.

We also register our symbol lookup table function so that it can
scan the list of payloads and retrieve the correct name.

Lastly we change vsprintf to take into account s and namebuf.
For core code they are the same, but for payloads they are different.
This gets us:

Xen call trace:
   [<ffff82d080a00041>] revert_hook+0x31/0x35 [xen_hello_world]
   [<ffff82d0801431bd>] xsplice.c#revert_payload+0x86/0xc6
   [<ffff82d080143502>] check_for_xsplice_work+0x233/0x3cd
   [<ffff82d08017a0b2>] domain.c#continue_idle_domain+0x9/0x1f

Which is great if payloads have similar or same symbol names.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/common/vsprintf.c
xen/common/xsplice.c
xen/include/xen/xsplice.h